/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { useEffect } from 'react';
import { Typography } from 'antd';
import { connect } from 'dva';
import { setLStorage } from '@/utils/utils';
import router from 'umi/router';
import styles from './style.less';

const { Title: AntTitle } = Typography;

const Statistics = ({ routerDate }) => {
  const { unique_id, _token } = routerDate.location.query;

  useEffect(
    () => {
      _token && setLStorage(unique_id, _token);
      router.push({
        pathname: '/league/chart',
        query: {
          unique_id,
        },
      });
    },
    [unique_id, _token],
  );

  return <AntTitle className={styles.noAuth}>页面跳转中</AntTitle>;
};

export default connect(({ router: routerDate }) => ({
  routerDate,
}))(React.memo(Statistics));
